﻿<phone:PhoneApplicationPage 
    x:Class="EbbinghausWord.Pages.ScorePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:my="clr-namespace:EbbinghausWord.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    
    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot" Margin="12">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <TextBlock x:Name="PageTitle" Text="学习成绩" Margin="0" 
                   Style="{StaticResource PhoneTextTitle1Style}"/>

        <StackPanel Grid.Row="1">
            <TextBlock Text="当前成绩" Style="{StaticResource PhoneTextLargeStyle}"/>
            <TextBlock Name="isLeanringBookTextBlock" Text="正在学习：" Style="{StaticResource PhoneTextSubtleStyle}"/>
            <TextBlock Name="totalScoreTextBlock" Text="总分：" Style="{StaticResource PhoneTextSubtleStyle}"/>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" Text="今日得分" Style="{StaticResource PhoneTextSubtleStyle}"/>
                <TextBlock Grid.Row="1" Name="todayScoreTextBlock" Grid.Column="0" HorizontalAlignment="Center" Text="" Style="{StaticResource PhoneTextLargeStyle}"/>
                <TextBlock Grid.Row="0" Grid.Column="1" HorizontalAlignment="Center" Text="目前成绩" Style="{StaticResource PhoneTextSubtleStyle}"/>
                <TextBlock Grid.Row="1" Name="currentScoreTextBlock" Grid.Column="1" HorizontalAlignment="Center" Text="" Style="{StaticResource PhoneTextLargeStyle}"/>
                <TextBlock Grid.Row="0" Grid.Column="2" HorizontalAlignment="Center" Text="完成度（%）" Style="{StaticResource PhoneTextSubtleStyle}"/>
                <TextBlock Grid.Row="1" Name="completeRatioTextBlock" Grid.Column="2" HorizontalAlignment="Center" Text="" Style="{StaticResource PhoneTextLargeStyle}"/>
            </Grid>
        </StackPanel>

        <Grid Grid.Row="2" Margin="0,20,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="45"/>
                <RowDefinition Height="45"/>
                <RowDefinition/>
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Text="历史成绩" Style="{StaticResource PhoneTextLargeStyle}"/>

            <Grid Height="30" Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="250"/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="日期" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock Grid.Column="1" Text="得分" Style="{StaticResource PhoneTextNormalStyle}"/>
            </Grid>

            <!--历史成绩列表-->
            <ListBox x:Name="scoreListBox" Grid.Row="2" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    </Style>
                </ListBox.ItemContainerStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="250"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="{Binding Path=Date}" Style="{StaticResource PhoneTextNormalStyle}"/>
                            <TextBlock Grid.Column="1" Text="{Binding Path=Score}" Style="{StaticResource PhoneTextNormalStyle}"/>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>

        <!--加载控件-->
        <my:LoadingControl Grid.RowSpan="3" x:Name="loadingControl"/>
    </Grid>

</phone:PhoneApplicationPage>